// $Id: UserPropertyEditor.java 31 2011-09-21 17:36:34Z huijzer@gmail.com $
package lime.user.editor;

import lime.common.LimeException;
import lime.model.User;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.forms.editor.FormEditor;

public class UserPropertyEditor extends FormEditor {
	
	public static final String ID = "lime.user.editor.property";
	
	@Override
	public void init(IEditorSite site, IEditorInput input) throws PartInitException {
		super.init(site, input);
		
		UserInput userInput = (UserInput) input;
		User user = userInput.getUser();
		setPartName(user.getObjectName());
	}
	
	@Override
	protected void addPages() {
		try {
			addPage(new UserPropertyPage(this));
		} catch (PartInitException e) {
			throw new LimeException(e);
		}
	}

	@Override
	public void doSave(IProgressMonitor monitor) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void doSaveAs() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean isSaveAsAllowed() {
		// TODO Auto-generated method stub
		return false;
	}

}
